cmake_minimum_required(VERSION 3.15)
project(demo_sdk)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)

# SWIG 生成的包装文件路径
set(SWIG_WRAP_FILE "${CMAKE_CURRENT_SOURCE_DIR}/./native_wrap.cpp")

# 源文件
set(SOURCES
    ./cpp.cpp
)

# 如果 SWIG 生成的包装文件存在，则添加
if(EXISTS ${SWIG_WRAP_FILE})
    message(STATUS "Found SWIG wrapper: ${SWIG_WRAP_FILE}")
    list(APPEND SOURCES ${SWIG_WRAP_FILE})
else()
    message(WARNING "SWIG wrapper not found: ${SWIG_WRAP_FILE}")
endif()

# 创建静态库
add_library(demo_sdk SHARED ${SOURCES})
